package com.han.walkman.controller;

import com.han.walkman.entity.RecommendSwiperEntity;
import com.han.walkman.service.RecommendSwiperService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Hanjiafeng
 * @Date: 2020/5/7
 * @Desc: 轮播图控制器
 */
@RestController
@RequestMapping("/recommendSwiper")
public class RecommendSwiperController {
    private final RecommendSwiperService recommendSwiperService;

    public RecommendSwiperController(RecommendSwiperService recommendSwiperService) {
        this.recommendSwiperService = recommendSwiperService;
    }

    /**
     * 查询顶部轮播图
     *
     * @return 轮播图list
     */
    @GetMapping("/findTop")
    public List<RecommendSwiperEntity> findTop() {
        return recommendSwiperService.findAll();
    }
}
